package pl.edu.agh.ssm.monitor.plotter;

import java.util.HashMap;
import java.util.Map;

import pl.edu.agh.ssm.monitor.visualization.NetGraph;

public class SessionPlotterContainer {

	private static Map<String, NetGraph> graphs;
	static {
		graphs = new HashMap<String, NetGraph>();
	}
	public SessionPlotterContainer() {
		graphs = new HashMap<String, NetGraph>();
	}
	
	public static NetGraph getGraph(String id) {
		return graphs.get(id);
	}
	
	public static void removeGraph(String id) {
		graphs.remove(id);
	}
	
	public static synchronized void addGraph(String id, NetGraph graph) {
//		System.out.println("Add net Graph called with graph: " + graph + ", id: " + id);
		try {
			graphs.put(id, graph);
		} catch(Exception e) {
			e.printStackTrace();
		}
//		System.out.println("NetGraph added");
	}
}
